<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>货损货差管理</title>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<meta name="decorator" content="ani"/>
	<%@ include file="/webpage/include/bootstraptable.jsp"%>
	<%@include file="/webpage/include/treeview.jsp" %>
	<%@include file="damagedList.js" %>
</head>
<body>
	<div class="wrapper wrapper-content">
	<div class="panel panel-primary">
	<div class="panel-heading">
		<h3 class="panel-title">货损货差列表</h3>
	</div>
	<div class="panel-body">
		<sys:message content="${message}"/>
	
	<!-- 搜索 -->
	<div class="accordion-group">
	<div id="collapseTwo" class="accordion-body collapse">
		<div class="accordion-inner">
			<form:form id="searchForm" modelAttribute="damaged" class="form form-horizontal well clearfix">
			 <div class="col-xs-12 col-sm-6 col-md-4">
				<label class="label-item single-overflow pull-left" title="项目：">项目：</label>
				<form:input path="pro" htmlEscape="false" maxlength="64"  class=" form-control"/>
			</div>
			 <div class="col-xs-12 col-sm-6 col-md-4">
				<div class="form-group">
					<label class="label-item single-overflow pull-left" title="日期：">&nbsp;日期：</label>
					<div class="col-xs-12">
						<div class='input-group date' id='rq' >
			                   <input type='text'  name="rq" class="form-control"  />
			                   <span class="input-group-addon">
			                       <span class="glyphicon glyphicon-calendar"></span>
			                   </span>
			            </div>	
					</div>
				</div>
			</div>
			 <div class="col-xs-12 col-sm-6 col-md-4">
				<label class="label-item single-overflow pull-left" title="起运地：">起运地：</label>
				<form:input path="qyd" htmlEscape="false" maxlength="64"  class=" form-control"/>
			</div>
			 <div class="col-xs-12 col-sm-6 col-md-4">
				<label class="label-item single-overflow pull-left" title="送达地：">送达地：</label>
				<form:input path="dzd" htmlEscape="false" maxlength="64"  class=" form-control"/>
			</div>
			 <div class="col-xs-12 col-sm-6 col-md-4">
				<label class="label-item single-overflow pull-left" title="类型：">类型：</label>
				<form:input path="type" htmlEscape="false" maxlength="64"  class=" form-control"/>
			</div>
			 <div class="col-xs-12 col-sm-6 col-md-4">
				<label class="label-item single-overflow pull-left" title="托运合同号：">托运合同号：</label>
				<form:input path="hth" htmlEscape="false" maxlength="64"  class=" form-control"/>
			</div>
			 <div class="col-xs-12 col-sm-6 col-md-4">
				<label class="label-item single-overflow pull-left" title="回执单号/提货单号：">回执单号/提货单号：</label>
				<form:input path="thdh" htmlEscape="false" maxlength="64"  class=" form-control"/>
			</div>
			 <div class="col-xs-12 col-sm-6 col-md-4">
				<label class="label-item single-overflow pull-left" title="责任方：">责任方：</label>
				<form:input path="zrf" htmlEscape="false" maxlength="255"  class=" form-control"/>
			</div>
			 <div class="col-xs-12 col-sm-6 col-md-4">
				<label class="label-item single-overflow pull-left" title="责任人：">责任人：</label>
				<form:input path="zrr" htmlEscape="false" maxlength="255"  class=" form-control"/>
			</div>
		 <div class="col-xs-12 col-sm-6 col-md-4">
			<div style="margin-top:26px">
			  <a  id="search" class="btn btn-primary btn-rounded  btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a>
			  <a  id="reset" class="btn btn-primary btn-rounded  btn-bordered btn-sm" ><i class="fa fa-refresh"></i> 重置</a>
			 </div>
	    </div>	
	</form:form>
	</div>
	</div>
	</div>
	
	<!-- 工具栏 -->
	<div id="toolbar">
			<shiro:hasPermission name="ap:damaged:add">
				<a id="add" class="btn btn-primary" onclick="add()"><i class="glyphicon glyphicon-plus"></i> 新建</a>
			</shiro:hasPermission>
			<shiro:hasPermission name="ap:damaged:edit">
			    <button id="edit" class="btn btn-success" disabled onclick="edit()">
	            	<i class="glyphicon glyphicon-edit"></i> 修改
	        	</button>
			</shiro:hasPermission>
			<shiro:hasPermission name="ap:damaged:del">
				<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
	            	<i class="glyphicon glyphicon-remove"></i> 删除
	        	</button>
			</shiro:hasPermission>
		<button id="qr" class="btn btn-danger" disabled onclick="qr()">
			<i class="glyphicon glyphicon-remove"></i> 确认
		</button>
		<button id="pf" class="btn btn-danger" disabled onclick="pf()">
			<i class="glyphicon glyphicon-remove"></i>赔付
		</button>
		<button id="zs" class="btn btn-danger" disabled onclick="zs()">
			<i class="glyphicon glyphicon-remove"></i> 追损
		</button>
			<shiro:hasPermission name="ap:damaged:import">
				<button id="btnImport" class="btn btn-info"><i class="fa fa-folder-open-o"></i> 导入</button>
				<div id="importBox" class="hide">
						<form id="importForm" action="${ctx}/ap/damaged/import" method="post" enctype="multipart/form-data"
							 style="padding-left:20px;text-align:center;" ><br/>
							<input id="uploadFile" name="file" type="file" style="width:330px"/>导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！<br/>　　
							
							
						</form>
				</div>
			</shiro:hasPermission>
	        	<a class="accordion-toggle btn btn-default" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
					<i class="fa fa-search"></i> 检索
				</a>
		    </div>
		
	<!-- 表格 -->
	<table id="damagedTable"  class="table text-nowrap" data-toolbar="#toolbar"></table>

    <!-- context menu -->

	</div>
	</div>
	</div>
	<div class="modal fade" id="zs1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h4 class="modal-title">追损</h4>
				</div>
				<div class="modal-body">
					<table class="table table-bordered">
						<tr>
							<td width="35%">追损方式</td>
							<td><input id="zsfs" class="form-control "/></td>
						</tr>
						<tr>
							<td width="35%">追损金额</td>
							<td><input id="zsje"  class="form-control "/></td>
						</tr>

						<tr>
							<td width="35%">追损日期</td>
							<td>
								<div class='input-group form_datetime' id='zssj'>
									<input type='text'  id="zsrq" class="form-control"  value="<fmt:formatDate value="${damaged.zssj}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
									<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
								</div>
						</tr>
						<tr>
							<td width="35%">追损说明</td>
							<td><input id="zssm"  class="form-control "/></td>
						</tr>

					</table>

				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-primary" onclick="zsqd()">确定</button>
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal -->
	</div>
	<div class="modal fade" id="pf1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h4 class="modal-title">赔付</h4>
				</div>
				<div class="modal-body">
					<table class="table table-bordered">
						<tr>
							<td width="35%">赔付方式</td>
							<td><input id="pffs"  class="form-control "/></td>
						</tr>
						<tr>
							<td width="35%">赔付金额</td>
							<td><input id="pfje" class="form-control "/></td>
						</tr>

						<tr>
							<td width="35%">赔付日期</td>
							<td>
								<div class='input-group form_datetime' id='pfrq1'>
									<input type='text'  id="pfrq" class="form-control"  value="<fmt:formatDate value="${damaged.zssj}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
									<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
								</div>
						</tr>
						<tr>
							<td width="35%">赔付说明</td>
							<td><input id="pfsm"  class="form-control "/></td>
						</tr>

					</table>

				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-primary" onclick="pfqd()">确定</button>
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal -->
	</div>
	<div class="modal fade" id="detil" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h4 class="modal-title">追损明细</h4>
				</div>
				<div class="modal-body">
					<table class="table table-bordered">
						<thead>
						<tr>
							<th>追损方式</th>
							<th>追损日期</th>
							<th>追损金额</th>
							<th>追损情况说明</th>
						</tr>
						</thead>
						<tbody id="dt"></tbody>
					</table>

				</div>

			</div><!-- /.modal-content -->
		</div><!-- /.modal -->
	</div>

</body>
</html>